import { setRequestHeader } from '@/common/request'
import { useUser, useShoppingCart,useIM } from '@/common/stores'
export const useLogin = () => {
	const { getUserInfo } = useUser()
	const { getCart } = useShoppingCart()
	// const {IMLogin} = useIM()
	const login = async (token?:string) => {
		uni.setStorageSync('token', token)
		setRequestHeader()
		getCart()
		const res = await getUserInfo()
		// IMLogin(res)
		return res
		
	}
	return {
		login
	}
}